package cn.wzx.service;

import cn.wzx.entity.Hot;
import cn.wzx.mapper.HotMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HotServiceImpl implements HotService {
    @Autowired(required = false)
    HotMapper hotMapper;

    // 添加热点
    @Override
    public void addHot(Hot hot) {
        hotMapper.addHot(hot);
    }

    // 删除热点
    @Override
    public void delete(Integer id) {
        hotMapper.delete(id);
    }

    // 热点全查询
    @Override
    public List<Hot> findAll() {
        return hotMapper.findAll();
    }

    // 根据类型查询分页查询
    @Override
    public List<Hot> findByType(int type, int num) {
        return hotMapper.findByType(type, num);
    }
}
